#include "setpage.h"
#include "ui_setpage.h"
#include "mainWidget.h"

SetPage::SetPage(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::SetPage)
{
    ui->setupUi(this);

    pWidget = static_cast<Widget*>(parent);

    //进入设置界面的各个子窗口
    connect(ui->Btn_userSet, &QPushButton::clicked, this, [=](){
        pWidget->changeSetPage(User_id);
    });
    connect(ui->Btn_signalSet, &QPushButton::clicked, this, [=](){
        pWidget->changeSetPage(Signal_id);
    });
    connect(ui->Btn_safeSet, &QPushButton::clicked, this, [=](){
        pWidget->changeSetPage(Safe_id);
    });
    connect(ui->Btn_sysSet, &QPushButton::clicked, this, [=](){
        pWidget->changeSetPage(System_id);
    });
    connect(ui->Btn_progSet, &QPushButton::clicked, this, [=](){
        pWidget->changeSetPage(Program_id);
    });
    connect(ui->Btn_exFuncSet, &QPushButton::clicked, this, [=](){
        pWidget->changeSetPage(ExFunction_id);
    });
}

SetPage::~SetPage()
{
    delete ui;
}
